home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / PROGWOB / PWOCYOCC.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-26  |  2.6 KB  |  85 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCYOCC 
  3.    Caption         =   "Creating Your Own Collection Classes"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form2"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton cmdBricks 
  13.       Caption         =   "House of Bricks"
  14.       Height          =   375
  15.       Left            =   240
  16.       TabIndex        =   2
  17.       Top             =   1200
  18.       Width           =   3255
  19.    End
  20.    Begin VB.CommandButton cmdSticks 
  21.       Caption         =   "House of Sticks"
  22.       Height          =   375
  23.       Left            =   240
  24.       TabIndex        =   1
  25.       Top             =   720
  26.       Width           =   3255
  27.    End
  28.    Begin VB.CommandButton cmdStraw 
  29.       Caption         =   "House of Straw"
  30.       Height          =   375
  31.       Left            =   240
  32.       TabIndex        =   0
  33.       Top             =   240
  34.       Width           =   3255
  35.    End
  36. Attribute VB_Name = "frmCYOCC"
  37. Attribute VB_GlobalNameSpace = False
  38. Attribute VB_Creatable = False
  39. Attribute VB_PredeclaredId = True
  40. Attribute VB_Exposed = False
  41. Option Explicit
  42. ' frmCYOCC shows its subsidiary forms using
  43. '   the hidden global variables Visual
  44. '   Basic creates for each form class
  45. '   (frmStraw, frmSticks, and frmBricks,
  46. '   in this case).  The hidden global
  47. '   variable is described in "Life Cycle
  48. '   of Visual Basic Forms" in Books Online.
  49. ' The forms are shown modeless, and
  50. '   frmCYOCC specifies itself (Me) as the
  51. '   owner of each form.  As a result, the
  52. '   owned forms always appear on top of
  53. '   frmCYOCC.
  54. ' House of Straw -- the public Collection object.
  55. Private Sub cmdStraw_Click()
  56.     frmStraw.Show vbModeless, Me
  57. End Sub
  58. ' House of Sticks -- the private Collection object.
  59. Private Sub cmdSticks_Click()
  60.     frmSticks.Show vbModeless, Me
  61. End Sub
  62. ' House of Bricks -- the Collection Class.
  63. Private Sub cmdBricks_Click()
  64.     frmBricks.Show vbModeless, Me
  65. End Sub
  66. Private Sub Form_Unload(Cancel As Integer)
  67.     ' If any of the modeless forms are
  68.     '   still loaded, close them.
  69.     If Not frmBricks Is Nothing Then
  70.         Unload frmBricks
  71.         Set frmBricks = Nothing
  72.     End If
  73.     If Not frmSticks Is Nothing Then
  74.         Unload frmBricks
  75.         Set frmBricks = Nothing
  76.     End If
  77.     If Not frmStraw Is Nothing Then
  78.         Unload frmBricks
  79.         Set frmBricks = Nothing
  80.     End If
  81.     ' Set the hidden global for frmCYOCC
  82.     '   to Nothing, freeing its resources.
  83.     Set frmCYOCC = Nothing
  84. End Sub
  85.